/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.longview.io.modules.sys.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.longview.io.common.service.TreeService;
import com.longview.io.common.utils.StringUtils;
import com.longview.io.modules.sys.entity.AlertType;
import com.longview.io.modules.sys.dao.AlertTypeDao;

/**
 * 预警类型树形结构Service
 * @author zf
 * @version 2017-11-08
 */
@Service
@Transactional(readOnly = true)
public class AlertTypeService extends TreeService<AlertTypeDao, AlertType> {

	public AlertType get(String id) {
		return super.get(id);
	}
	
	public List<AlertType> findList(AlertType alertType) {
		if (StringUtils.isNotBlank(alertType.getParentIds())){
			alertType.setParentIds(","+alertType.getParentIds()+",");
		}
		return super.findList(alertType);
	}
	
	@Transactional(readOnly = false)
	public void save(AlertType alertType) {
		super.save(alertType);
	}
	
	@Transactional(readOnly = false)
	public void delete(AlertType alertType) {
		super.delete(alertType);
	}
	
}